<script setup>
import { ref } from "vue";

const msg = ref("你好世界");
const clicked = ref(false);

const button = () => {
  clicked.value = !clicked.value;
  clicked.value ? (msg.value = "度过难关") : (msg.value = "你好世界");
};
</script>

<template>
  <h3>{{ msg }}</h3>
  <br />
  <button @click="button">点击事件</button>
</template>

<style scoped></style>
